<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script src="./js/jquery.js"></script>

  <script>
    // 1 $.get 获取英雄数据
    // $.get("http://127.0.0.1:3001/getHeroSkin", (res) => {
    //   console.log(res);
    // })

    // 2 $.ajax  get 
    // $.ajax({
    //   url: "http://127.0.0.1:3001/getHeroSkin",
    //   // type: "get", // 默认是 get请求
    //   data: {
    //     heroName: "小乔"
    //   },
    //   success: function (res) {
    //     console.log(res);
    //   }
    // })

    // 3 $.ajax post 

    $.ajax({
      url: "http://127.0.0.1:3001/addHeroSkin",
      type: "post",
      data: {
        cname: "孙悟空123",
        skin_name: "豹纹"
      },
      success: function (res) {
        console.log(res);
      }
    })



  </script>
</body>

</html>